home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / execswp.com / TEST.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1989-04-04  |  527 b   |  20 lines

  1. program TestExecSwap;
  2. uses
  3.   Dos,ExecSwap; {Keep ExecSwap last}
  4. const
  5.   SwapLoc : array[Boolean] of String[7] = ('on disk', 'in EMS');
  6. var
  7.   Status : Word;
  8. begin
  9.   UseEmsIfAvailable := True;
  10.   if not InitExecSwap(HeapPtr, 'SWAP.$$$') then
  11.     WriteLn('Unable to allocate swap space')
  12.   else begin
  13.     WriteLn('Allocated ', BytesSwapped, ' bytes ', SwapLoc[EmsAllocated]);
  14.     SwapVectors;
  15.     Status := ExecWithSwap(GetEnv('COMSPEC'), '');
  16.     SwapVectors;
  17.     WriteLn('Exec status: ', Status);
  18.   end;
  19. end.
  20.